home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update27.zoo / gcc-233 / gcc-233.diff < prev    next >
Encoding:
Text File  |  1992-12-28  |  64.9 KB  |  2,428 lines

  1. diff -c -r ngcc/c-decl.c gcc/c-decl.c
  2. *** ngcc/c-decl.c    Mon Dec 28 00:44:14 1992
  3. --- gcc/c-decl.c    Mon Dec 28 00:27:25 1992
  4. ***************
  5. *** 5885,5890 ****
  6. --- 5885,5892 ----
  7.   
  8.     expand_function_start (fndecl, 0);
  9.   
  10. + #if (!(defined(atarist) || defined(CROSSATARI) || defined(atariminix)))
  11. +   /* we will only need this in cp-decl.c, not here */
  12.     /* If this function is `main', emit a call to `__main'
  13.        to run global initializers, etc.  */
  14.     if (DECL_NAME (fndecl)
  15. ***************
  16. *** 5891,5896 ****
  17. --- 5893,5899 ----
  18.         && strcmp (IDENTIFIER_POINTER (DECL_NAME (fndecl)), "main") == 0
  19.         && DECL_CONTEXT (fndecl) == NULL_TREE)
  20.       expand_main_function ();
  21. + #endif
  22.   }
  23.   
  24.   /* SPECPARMS is an identifier list--a chain of TREE_LIST nodes
  25. diff -c -r ngcc/c-lex.c gcc/c-lex.c
  26. *** ngcc/c-lex.c    Mon Nov 30 15:33:14 1992
  27. --- gcc/c-lex.c    Mon Dec 28 00:27:29 1992
  28. ***************
  29. *** 391,396 ****
  30. --- 391,397 ----
  31.       case '\r':
  32.         /* ANSI C says the effects of a carriage return in a source file
  33.            are undefined.  */
  34. + #ifndef atarist /* but not on an atarist, though hopefully we should'nt see it */
  35.         if (pedantic && !newline_warning)
  36.           {
  37.             warning ("carriage return in source file");
  38. ***************
  39. *** 397,402 ****
  40. --- 398,404 ----
  41.             warning ("(we only warn about the first carriage return)");
  42.             newline_warning = 1;
  43.           }
  44. + #endif
  45.         c = getc (finput);
  46.         break;
  47.   
  48. diff -c -r ngcc/cccp.c gcc/cccp.c
  49. *** ngcc/cccp.c    Mon Dec 28 00:44:16 1992
  50. --- gcc/cccp.c    Mon Dec 28 00:27:32 1992
  51. ***************
  52. *** 71,76 ****
  53. --- 71,78 ----
  54.   #undef bzero
  55.   #undef bcmp
  56.   
  57. + #ifndef atarist
  58.   #include <sys/types.h>
  59.   #include <sys/stat.h>
  60.   #include <ctype.h>
  61. ***************
  62. *** 77,91 ****
  63.   #include <stdio.h>
  64.   
  65.   #ifndef VMS
  66. ! #ifndef USG
  67.   #include <sys/time.h>        /* for __DATE__ and __TIME__ */
  68.   #include <sys/resource.h>
  69.   #else
  70.   #include <time.h>
  71.   #include <fcntl.h>
  72. ! #endif /* USG */
  73.   #endif /* not VMS */
  74.   
  75.   /* VMS-specific definitions */
  76.   #ifdef VMS
  77.   #include <time.h>
  78. --- 79,111 ----
  79.   #include <stdio.h>
  80.   
  81.   #ifndef VMS
  82. ! #if (!(defined(USG) || defined(atariminix)))
  83.   #include <sys/time.h>        /* for __DATE__ and __TIME__ */
  84.   #include <sys/resource.h>
  85.   #else
  86.   #include <time.h>
  87.   #include <fcntl.h>
  88. ! #endif /* USG or atariminix */
  89.   #endif /* not VMS */
  90.   
  91. + #else    /* atarist */
  92. + #include <ctype.h>
  93. + #include <stdio.h>
  94. + #include <types.h>
  95. + #include <stat.h>
  96. + #include <file.h>
  97. + #include <time.h>
  98. + #include <string.h>
  99. + #include "stddef.h"
  100. + long _stksize = -1L;    /* want big stack cause include files
  101. +                    get alloca'ed there */
  102. + #define read(fd,buf,size)    _text_read(fd,buf,size)
  103. + #endif        /* atarist */
  104.   /* VMS-specific definitions */
  105.   #ifdef VMS
  106.   #include <time.h>
  107. ***************
  108. *** 925,930 ****
  109. --- 945,971 ----
  110.   /* Nonzero means -I- has been seen,
  111.      so don't look for #include "foo" the source-file directory.  */
  112.   static int ignore_srcdir;
  113. +  
  114. + #ifdef atarist
  115. + /* the following dingus is used in place of some calls to bcopy,
  116. +    to ensure that backslashes get properly slashified when getting
  117. +    shoved into strings.  Note that it returns the new pointer!!
  118. +    There ought to be a better way... */
  119. + U_CHAR * slashifying_bcopy(from_buf, to_buf, nbytes)
  120. + U_CHAR * from_buf, * to_buf;
  121. + int nbytes;
  122. + {
  123. +   for ( ; nbytes > 0 ; )
  124. +     {
  125. +     if(*from_buf == '\\')
  126. +         *to_buf++ = '\\';
  127. +     *to_buf++ = *from_buf++;
  128. +     nbytes--;
  129. +     }
  130. +   return(to_buf);
  131. + }
  132. + #endif        /* atarist */
  133.   
  134.   int
  135.   main (argc, argv)
  136. ***************
  137. *** 963,968 ****
  138. --- 1004,1014 ----
  139.     /* Target-name to write with the dependency information.  */
  140.     char *deps_target = 0;
  141.   
  142. + #ifdef atarist
  143. + /* turn this on if you are going to set the TOS 1.4 dont clear heap flag */
  144. + /*  _malloczero(1); */     /* zero mallocs by default */
  145. + #endif  
  146.   #ifdef RLIMIT_STACK
  147.     /* Get rid of any avoidable limit on stack size.  */
  148.     {
  149. ***************
  150. *** 1210,1219 ****
  151. --- 1256,1271 ----
  152.       break;
  153.   
  154.         case 'v':
  155. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  156. + #include "PatchLev.h"
  157. +     fprintf (stderr, "GNU CPP-atariST version %s Patchlevel %s",
  158. +          version_string, PatchLevel);
  159. + #else
  160.       fprintf (stderr, "GNU CPP version %s", version_string);
  161.   #ifdef TARGET_VERSION
  162.       TARGET_VERSION;
  163.   #endif
  164. + #endif
  165.       fprintf (stderr, "\n");
  166.       break;
  167.   
  168. ***************
  169. *** 1345,1350 ****
  170. --- 1397,1403 ----
  171.       }
  172.     }
  173.   
  174. + #if (!(defined(atarist) || defined(CROSSATARI) || defined(atariminix)))
  175.     /* Add dirs from CPATH after dirs from -I.  */
  176.     /* There seems to be confusion about what CPATH should do,
  177.        so for the moment it is not documented.  */
  178. ***************
  179. *** 1354,1359 ****
  180. --- 1407,1413 ----
  181.     p = (char *) getenv ("CPATH");
  182.     if (p != 0 && ! no_standard_includes)
  183.       path_include (p);
  184. + #endif
  185.   
  186.     /* Now that dollars_in_ident is known, initialize is_idchar.  */
  187.     initialize_char_syntax ();
  188. ***************
  189. *** 1472,1479 ****
  190.     { /* read the appropriate environment variable and if it exists
  191.          replace include_defaults with the listed path. */
  192.       char *epath = 0;
  193.       switch ((objc << 1) + cplusplus)
  194. !       {
  195.         case 0:
  196.       epath = getenv ("C_INCLUDE_PATH");
  197.       break;
  198. --- 1526,1581 ----
  199.     { /* read the appropriate environment variable and if it exists
  200.          replace include_defaults with the listed path. */
  201.       char *epath = 0;
  202. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  203. +     int db_hack = 0;
  204. +     char *e1 = getenv("GNUINC"), *e2 = getenv("GNULIB"),
  205. +          *e3 = getenv("GXXINC");
  206. +     /* Get length of the alloc'ed array. (Yeah I know, I might alloc
  207. +      * a character more than I need but who cares...
  208. +      */
  209. +     if (cplusplus && e3)
  210. +     db_hack += strlen (e3);
  211. +     if (e1)
  212. +         db_hack += strlen (e1) + 1;
  213. +     if (e2)
  214. +         db_hack += strlen (e1) + 1;
  215. +     if (db_hack) {
  216. +     epath = alloca (db_hack + 1);
  217. +     *epath = '\0';
  218. +     db_hack = 0;
  219. +     /* Concatenate the paths together. */
  220. +     if (cplusplus && e3) {
  221. +         strcpy (epath, e3);
  222. +         db_hack = 1;
  223. +     }
  224. +     if (e1) {
  225. +         if (db_hack) {
  226. +         strcat (epath, PATH_SEP_STR);
  227. +         }
  228. +         strcat (epath, e1);
  229. +         db_hack = 1;
  230. +     }
  231. +     if (e2) {
  232. +         if (db_hack) {
  233. +         strcat (epath, PATH_SEP_STR);
  234. +         }
  235. +         strcat (epath, e2);
  236. +     }
  237. +     }
  238. + #ifdef atarist
  239. +     if (epath)
  240. +         for (e3=epath; *e3; e3++)    /* Use one kind of path separator */
  241. +         if (*e3 == ';')
  242. +         *e3 = PATH_SEPARATOR;
  243. + #endif
  244. + #else
  245.       switch ((objc << 1) + cplusplus)
  246. !     {
  247.         case 0:
  248.       epath = getenv ("C_INCLUDE_PATH");
  249.       break;
  250. ***************
  251. *** 1486,1492 ****
  252.         case 3:
  253.       epath = getenv ("OBJCPLUS_INCLUDE_PATH");
  254.       break;
  255. !       }
  256.       /* If the environment var for this language is set,
  257.          add to the default list of include directories.  */
  258.       if (epath) {
  259. --- 1588,1596 ----
  260.         case 3:
  261.       epath = getenv ("OBJCPLUS_INCLUDE_PATH");
  262.       break;
  263. !     }
  264. ! #endif
  265.       /* If the environment var for this language is set,
  266.          add to the default list of include directories.  */
  267.       if (epath) {
  268. ***************
  269. *** 1540,1546 ****
  270. --- 1644,1654 ----
  271.     if (!no_standard_includes) {
  272.       struct default_include *p = include_defaults;
  273.       char *specd_prefix = include_prefix;
  274. + #ifdef GCC_INCLUDE_DIR
  275.       char *default_prefix = savestring (GCC_INCLUDE_DIR);
  276. + #else
  277. +     char *default_prefix = savestring ("./");
  278. + #endif
  279.       int default_len = 0;
  280.       /* Remove the `include' from /usr/local/lib/gcc.../include.  */
  281.       if (!strcmp (default_prefix + strlen (default_prefix) - 8, "/include")) {
  282. ***************
  283. *** 1547,1552 ****
  284. --- 1655,1666 ----
  285.         default_len = strlen (default_prefix) - 7;
  286.         default_prefix[default_len] = 0;
  287.       }
  288. + #ifdef atarist
  289. +     else if (!strcmp (default_prefix + strlen (default_prefix) - 8, "\\include")) {
  290. +       default_len = strlen (default_prefix) - 7;
  291. +       default_prefix[default_len] = 0;
  292. +     }
  293. + #endif
  294.       /* Search "translated" versions of GNU directories.
  295.          These have /usr/local/lib/gcc... replaced by specd_prefix.  */
  296.       if (specd_prefix != 0 && default_len != 0)
  297. ***************
  298. *** 1673,1679 ****
  299. --- 1787,1797 ----
  300.         char *p1 = p;
  301.         /* Discard all directory prefixes from P.  */
  302.         while (*p1) {
  303. + #ifdef atarist
  304. +     if ((*p1 == '/') || (*p1 == '\\'))
  305. + #else
  306.       if (*p1 == '/')
  307. + #endif
  308.         p = p1 + 1;
  309.       p1++;
  310.         }
  311. ***************
  312. *** 1835,1840 ****
  313. --- 1953,1959 ----
  314.     return 0;
  315.   }
  316.   
  317. + #if (!(defined(atarist) || defined(CROSSATARI) || defined(atariminix)))
  318.   /* Given a colon-separated list of file names PATH,
  319.      add all the names to the search path for include files.  */
  320.   
  321. ***************
  322. *** 1881,1886 ****
  323. --- 2000,2006 ----
  324.         p++;
  325.       }
  326.   }
  327. + #endif /* atarist */
  328.   
  329.   /* Pre-C-Preprocessor to translate ANSI trigraph idiocy in BUF
  330.      before main CCCP processing.  Name `pcp' is also in honor of the
  331. ***************
  332. *** 3040,3045 ****
  333. --- 3160,3166 ----
  334.     assertions_flag = save_assertions_flag;
  335.     return obuf;
  336.   }
  337. + /* #endif */
  338.   
  339.   /*
  340.    * Process a # directive.  Expects IP->bufp to point after the '#', as in
  341. ***************
  342. *** 3501,3508 ****
  343. --- 3622,3638 ----
  344.   
  345.         if (string)
  346.       {
  347. + #ifndef atarist
  348.         buf = (char *) alloca (3 + strlen (string));
  349.         sprintf (buf, "\"%s\"", string);
  350. + #else
  351. +           buf = (char *) alloca (16 + strlen (string));
  352. +           {
  353. +           char *tbuf = (char *) alloca (16 + strlen (string));
  354. +           (void) slashifying_bcopy(string, tbuf, strlen(string)+1);
  355. +           sprintf (buf, "\"%s\"", tbuf);
  356. +           }
  357. + #endif /* atarist */
  358.       }
  359.         else
  360.       buf = "\"\"";
  361. ***************
  362. *** 3724,3730 ****
  363. --- 3854,3865 ----
  364.           dsp[0].next = search_start;
  365.           search_start = dsp;
  366.   #ifndef VMS
  367. + #ifdef atarist
  368. +         if((ep = rindex(nam, '\\')) == NULL)
  369. +         ep = rindex(nam, '/');
  370. + #else
  371.           ep = rindex (nam, '/');
  372. + #endif
  373.   #else                /* VMS */
  374.           ep = rindex (nam, ']');
  375.           if (ep == NULL) ep = rindex (nam, '>');
  376. ***************
  377. *** 3800,3808 ****
  378. --- 3935,3957 ----
  379.   
  380.     /* If specified file name is absolute, just open it.  */
  381.   
  382. + #ifdef atarist
  383. +   if ((*fbeg == '\\') || (*fbeg == '/')) {
  384. +     if(fbeg[2] == ':')
  385. +     { /* allow "\D:\xxx" */
  386. +         strncpy (fname, fbeg+1, flen-1);
  387. +         fname[flen-1] = 0;
  388. +     }
  389. +     else
  390. +     {  /* allow "\lib\xxx" == "\currentdrive:\lib\xxx" */
  391. +         strncpy (fname, fbeg, flen);
  392. +         fname[flen] = 0;
  393. +     }
  394. + #else
  395.     if (*fbeg == '/') {
  396.       strncpy (fname, fbeg, flen);
  397.       fname[flen] = 0;
  398. + #endif
  399.       if (redundant_include_p (fname))
  400.         return 0;
  401.       if (importing)
  402. ***************
  403. *** 3823,3829 ****
  404. --- 3972,3982 ----
  405.       if (searchptr->fname[0] == 0)
  406.         continue;
  407.       strcpy (fname, searchptr->fname);
  408. + #ifdef atarist
  409. +     strcat (fname, "\\");
  410. + #else
  411.       strcat (fname, "/");
  412. + #endif
  413.       fname[strlen (fname) + flen] = 0;
  414.         } else {
  415.       fname[0] = 0;
  416. ***************
  417. *** 3945,3961 ****
  418.   
  419.       if (!no_precomp)
  420.         do {
  421.       sprintf (pcftry, "%s%d", fname, pcfnum++);
  422.       
  423.       pcf = open (pcftry, O_RDONLY, 0666);
  424.       if (pcf != -1)
  425.         {
  426.           struct stat s;
  427.   
  428.           fstat (pcf, &s);
  429.           if (bcmp (&stat_f.st_ino, &s.st_ino, sizeof (s.st_ino))
  430.           || stat_f.st_dev != s.st_dev)
  431. !           {
  432.           pcfbuf = check_precompiled (pcf, fname, &pcfbuflimit);
  433.           /* Don't need it any more.  */
  434.           close (pcf);
  435. --- 4098,4156 ----
  436.   
  437.       if (!no_precomp)
  438.         do {
  439. + #ifdef atarist
  440. +     int numlen;
  441. +     char *dot;
  442. +     char *slash;
  443. +     /* cut extension to 3 chars and dont depend on UNIXMODE           */
  444. +     /* this will have to be done when saving precompiled headers, too */
  445. +     /* but as far as I tried, they dont work up to now, anyway   (AL) */
  446. +       if( pcfnum>=100 )     numlen=3;
  447. +       else if( pcfnum>=10 ) numlen=2;
  448. +       else                  numlen=1;
  449. +       dot=strrchr( fname, '.' );
  450. +       if( (slash=strrchr( fname, '/')) && slash>dot )
  451. +         dot=NULL;
  452. +       else
  453. +       if( (slash=strrchr( fname, '\\')) && slash>dot )
  454. +         dot=NULL;
  455. +       if( dot ) {
  456. +         if( strlen(dot)-1>3-numlen ) {
  457. +           sprintf(pcftry, "%.*s%d", strlen(fname)-(strlen(dot)-(4-numlen)),
  458. +                   fname, pcfnum++);
  459. +         } else {
  460. +           sprintf(pcftry, "%s%d", fname, pcfnum++);
  461. +         }
  462. +       } else {
  463. +         sprintf( pcftry, "%s.%d", fname, pcfnum++);
  464. +       }
  465. + #else    /* looks like we got a sane filesystem */
  466.       sprintf (pcftry, "%s%d", fname, pcfnum++);
  467. + #endif
  468. + #if 0
  469. +     fprintf ( stderr, "trying precompiled file %s.\n", pcftry );
  470. + #endif
  471.       
  472.       pcf = open (pcftry, O_RDONLY, 0666);
  473.       if (pcf != -1)
  474.         {
  475. + #ifndef atarist
  476. +         /* dont bother with this on the ST since these field are faked
  477. +          * anyways
  478. +              */
  479.           struct stat s;
  480.   
  481.           fstat (pcf, &s);
  482.           if (bcmp (&stat_f.st_ino, &s.st_ino, sizeof (s.st_ino))
  483.           || stat_f.st_dev != s.st_dev)
  484. ! #else
  485. !         if (1)
  486. ! #endif
  487. !               {
  488.           pcfbuf = check_precompiled (pcf, fname, &pcfbuflimit);
  489.           /* Don't need it any more.  */
  490.           close (pcf);
  491. ***************
  492. *** 6832,6839 ****
  493. --- 7027,7038 ----
  494.     check_expand (op, len + 1);
  495.     if (op->bufp > op->buf && op->bufp[-1] != '\n')
  496.       *op->bufp++ = '\n';
  497. + #ifdef atarist
  498. +   op->bufp = slashifying_bcopy (line_cmd_buf, op->bufp, len);
  499. + #else
  500.     bcopy (line_cmd_buf, op->bufp, len);
  501.     op->bufp += len;
  502. + #endif
  503.     op->lineno = ip->lineno;
  504.   }
  505.   
  506. ***************
  507. *** 8477,8482 ****
  508. --- 8676,8682 ----
  509.     deps_buffer[deps_size] = 0;
  510.   }
  511.   
  512. + #if (!(defined(atarist) || defined(atariminix)))
  513.   #if defined(USG) || defined(VMS)
  514.   #ifndef BSTRING
  515.   
  516. ***************
  517. *** 8513,8519 ****
  518.   }
  519.   #endif /* not BSTRING */
  520.   #endif /* USG or VMS */
  521.   
  522.   static void
  523.   fatal (str, arg)
  524. --- 8713,8719 ----
  525.   }
  526.   #endif /* not BSTRING */
  527.   #endif /* USG or VMS */
  528. ! #endif /* any atari */
  529.   
  530.   static void
  531.   fatal (str, arg)
  532. diff -c -r ngcc/config/alpha.h gcc/config/alpha.h
  533. *** ngcc/config/alpha.h    Mon Dec 28 00:44:21 1992
  534. --- gcc/config/alpha.h    Mon Dec 28 00:28:26 1992
  535. ***************
  536. *** 1256,1262 ****
  537.   { extern char *version_string;                    \
  538.     char *p, *after_dir = main_input_filename;            \
  539.                                   \
  540. !   fprintf (FILE, "\t.verstamp 9 0 ");                \
  541.     for (p = version_string; *p != ' ' && *p != 0; p++)        \
  542.       fprintf (FILE, "%c", *p == '.' ? ' ' : *p);            \
  543.     fprintf (FILE, "\n\t.set noreorder\n");            \
  544. --- 1256,1262 ----
  545.   { extern char *version_string;                    \
  546.     char *p, *after_dir = main_input_filename;            \
  547.                                   \
  548. !   fprintf (FILE, "\t.verstamp 8 0 ");                \
  549.     for (p = version_string; *p != ' ' && *p != 0; p++)        \
  550.       fprintf (FILE, "%c", *p == '.' ? ' ' : *p);            \
  551.     fprintf (FILE, "\n\t.set noreorder\n");            \
  552. diff -c -r ngcc/config/m68k.c gcc/config/m68k.c
  553. *** ngcc/config/m68k.c    Mon Nov 30 15:37:41 1992
  554. --- gcc/config/m68k.c    Mon Dec 28 00:28:29 1992
  555. ***************
  556. *** 60,66 ****
  557.      
  558.   finalize_pic ()
  559.   {
  560. !   if (flag_pic && current_function_uses_pic_offset_table)
  561.       emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
  562.   }
  563.   
  564. --- 60,66 ----
  565.      
  566.   finalize_pic ()
  567.   {
  568. !   if (flag_pic && (flag_pic < 3) && current_function_uses_pic_offset_table)
  569.       emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
  570.   }
  571.   
  572. ***************
  573. *** 213,219 ****
  574.         asm_fprintf (stream, "\tmoveml %0I0x%x,%Rsp@-\n", mask);
  575.   #endif
  576.       }
  577. !   if (flag_pic && current_function_uses_pic_offset_table)
  578.       {
  579.   #ifdef MOTOROLA
  580.         asm_fprintf (stream, "\t%Omove.l %0I__GLOBAL_OFFSET_TABLE_, %s\n",
  581. --- 213,219 ----
  582.         asm_fprintf (stream, "\tmoveml %0I0x%x,%Rsp@-\n", mask);
  583.   #endif
  584.       }
  585. !   if (flag_pic && (flag_pic < 3) && current_function_uses_pic_offset_table)
  586.       {
  587.   #ifdef MOTOROLA
  588.         asm_fprintf (stream, "\t%Omove.l %0I__GLOBAL_OFFSET_TABLE_, %s\n",
  589. ***************
  590. *** 803,814 ****
  591.     /* First handle a simple SYMBOL_REF or LABEL_REF */
  592.     if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
  593.       {
  594.         if (reg == 0)
  595.       abort ();
  596.   
  597. !       pic_ref = gen_rtx (MEM, Pmode,
  598. !              gen_rtx (PLUS, Pmode,
  599. !                   pic_offset_table_rtx, orig));
  600.         current_function_uses_pic_offset_table = 1;
  601.         RTX_UNCHANGING_P (pic_ref) = 1;
  602.         emit_move_insn (reg, pic_ref);
  603. --- 803,822 ----
  604.     /* First handle a simple SYMBOL_REF or LABEL_REF */
  605.     if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
  606.       {
  607. + #ifdef LEGITIMATE_BASEREL_OPERAND_P
  608. +   if (LEGITIMATE_BASEREL_OPERAND_P (orig))
  609. +     return orig;
  610. + #endif
  611.         if (reg == 0)
  612.       abort ();
  613.   
  614. !       if (flag_pic == 3)
  615. !         pic_ref = gen_rtx (PLUS, Pmode, pic_offset_table_rtx, orig);
  616. !       else
  617. !         pic_ref = gen_rtx (MEM, Pmode,
  618. !                gen_rtx (PLUS, Pmode,
  619. !                     pic_offset_table_rtx, orig));
  620.         current_function_uses_pic_offset_table = 1;
  621.         RTX_UNCHANGING_P (pic_ref) = 1;
  622.         emit_move_insn (reg, pic_ref);
  623. ***************
  624. *** 840,845 ****
  625. --- 848,854 ----
  626.         pic_ref = gen_rtx (PLUS, Pmode, base, orig);
  627.         /* Likewise, should we set special REG_NOTEs here?  */
  628.       }
  629.     return pic_ref;
  630.   }
  631.   
  632. ***************
  633. *** 1582,1587 ****
  634. --- 1591,1599 ----
  635.         output_address (XEXP (op, 0));
  636.         if (letter == 'd' && ! TARGET_68020
  637.         && CONSTANT_ADDRESS_P (XEXP (op, 0))
  638. +       && !(TARGET_PC_REL && GET_CODE (XEXP (op, 0)) == SYMBOL_REF
  639. +            && SYMBOL_REF_FLAG (XEXP (op, 0))
  640. +            && !SYMBOL_REF_USED (XEXP (op, 0)))
  641.         && !(GET_CODE (XEXP (op, 0)) == CONST_INT
  642.              && INTVAL (XEXP (op, 0)) < 0x8000
  643.              && INTVAL (XEXP (op, 0)) >= -0x8000))
  644. ***************
  645. *** 1887,1892 ****
  646. --- 1899,1906 ----
  647.                 fprintf (file, ":w");
  648.               if ((flag_pic == 2) && (breg == pic_offset_table_rtx))
  649.                 fprintf (file, ":l");
  650. +             if ((flag_pic == 3) && (breg == pic_offset_table_rtx))
  651. +               fprintf (file, ":W");
  652.             }
  653.           if (addr != 0 && ireg != 0)
  654.             {
  655. ***************
  656. *** 1964,1969 ****
  657. --- 1978,1996 ----
  658.           fprintf (file, "%d:w", INTVAL (addr));
  659.   #endif
  660.         }
  661. +     else if (TARGET_PC_REL && GET_CODE (addr) == SYMBOL_REF
  662. +          && SYMBOL_REF_FLAG (addr)
  663. +          && !SYMBOL_REF_USED (addr))
  664. +       {
  665. + #ifdef MOTOROLA
  666. +         output_addr_const (file, addr);
  667. +         fputs ("(pc)", file);
  668. + #else
  669. +         fputs ("pc@(", file);
  670. +         output_addr_const (file, addr);
  671. +         putc (')', file);
  672. + #endif
  673. +       }
  674.       else
  675.         {
  676.           output_addr_const (file, addr);
  677. ***************
  678. *** 1971,1973 ****
  679. --- 1998,2015 ----
  680.       break;
  681.       }
  682.   }
  683. + #ifdef ENCODE_SECTION_INFO
  684. + /* Does operand (which is a symbolic_operand) live in text space? If
  685. +    so SYMBOL_REF_FLAG, which is set by ENCODE_SECTION_INFO, will be true.*/
  686. + int
  687. + read_only_operand (operand)
  688. +      rtx operand;
  689. + {
  690. +   if (GET_CODE (operand) == CONST)
  691. +     operand = XEXP (XEXP (operand, 0), 0);
  692. +   if (GET_CODE (operand) == SYMBOL_REF)
  693. +     return SYMBOL_REF_FLAG (operand) || CONSTANT_POOL_ADDRESS_P (operand);
  694. +   return 1;
  695. + }
  696. + #endif
  697. diff -c -r ngcc/config/m68k.h gcc/config/m68k.h
  698. *** ngcc/config/m68k.h    Mon Nov 30 15:37:43 1992
  699. --- gcc/config/m68k.h    Mon Dec 28 00:28:31 1992
  700. ***************
  701. *** 92,97 ****
  702. --- 92,103 ----
  703.   /* Use the 68040-only fp instructions (-m68040).  */
  704.   #define TARGET_68040_ONLY (target_flags & 01000)
  705.   
  706. + /* Use PC-relative addressing for refs to read-only data */
  707. + #define TARGET_PC_REL (target_flags & 02000)
  708. + /* Use base-relative addressing for refs to data&bss segments */
  709. + #define TARGET_BASE_REL (target_flags & 04000)
  710.   /* Macro to define tables used to set the flags.
  711.      This is a list in braces of pairs in braces,
  712.      each pair being { "NAME", VALUE }
  713. ***************
  714. *** 119,124 ****
  715. --- 125,134 ----
  716.       { "68030", -01400},                \
  717.       { "68030", 7},                \
  718.       { "68040", 01007},            \
  719. +     { "pcrel", 02000},                \
  720. +     { "nopcrel", -02000},            \
  721. +     { "baserel", 04000},            \
  722. +     { "nobaserel", -04000},            \
  723.       { "", TARGET_DEFAULT}}
  724.   /* TARGET_DEFAULT is defined in sun*.h and isi.h, etc.  */
  725.   
  726. ***************
  727. *** 130,135 ****
  728. --- 140,146 ----
  729.     if (TARGET_FPA) target_flags &= ~2;    \
  730.     if (! TARGET_68020 && flag_pic == 2)    \
  731.       error("-fPIC is not currently supported on the 68000 or 68010\n");    \
  732. +   if (TARGET_BASE_REL) flag_pic = 3;    \
  733.   }
  734.   #else
  735.   #define OVERRIDE_OPTIONS        \
  736. ***************
  737. *** 136,141 ****
  738. --- 147,153 ----
  739.   {                    \
  740.     if (! TARGET_68020 && flag_pic == 2)    \
  741.       error("-fPIC is not currently supported on the 68000 or 68010\n");    \
  742. +   if (TARGET_BASE_REL) flag_pic = 3;    \
  743.   }
  744.   #endif /* defined SUPPORT_SUN_FPA */
  745.   
  746. ***************
  747. *** 327,335 ****
  748.   #ifndef SUPPORT_SUN_FPA
  749.   
  750.   #define CONDITIONAL_REGISTER_USAGE \
  751. ! {                                               \
  752. !   if (flag_pic)                                 \
  753. !     fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;    \
  754.   }
  755.   
  756.   #else /* defined SUPPORT_SUN_FPA */
  757. --- 339,350 ----
  758.   #ifndef SUPPORT_SUN_FPA
  759.   
  760.   #define CONDITIONAL_REGISTER_USAGE \
  761. ! {                                                \
  762. !   if (flag_pic)                                  \
  763. !     fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;     \
  764. !   /* prevent saving/restoring of the base reg */ \
  765. !   if (flag_pic == 3)                 \
  766. !     call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
  767.   }
  768.   
  769.   #else /* defined SUPPORT_SUN_FPA */
  770. ***************
  771. *** 1111,1116 ****
  772. --- 1126,1133 ----
  773.          && REG_P (XEXP (X, 0)) && REG_OK_FOR_BASE_P (XEXP (X, 0))    \
  774.          && GET_CODE (XEXP (X, 1)) == CONST_INT                \
  775.          && ((unsigned) INTVAL (XEXP (X, 1)) + 0x8000) < 0x10000)        \
  776. +    || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx     \
  777. +        && flag_pic == 3 && CONSTANT_ADDRESS_P (XEXP (X, 1)))        \
  778.      || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx     \
  779.          && flag_pic && GET_CODE (XEXP (X, 1)) == SYMBOL_REF)        \
  780.      || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx     \
  781. diff -c -r ngcc/config/m68k.md gcc/config/m68k.md
  782. *** ngcc/config/m68k.md    Mon Nov 30 15:37:46 1992
  783. --- gcc/config/m68k.md    Mon Dec 28 00:28:35 1992
  784. ***************
  785. *** 704,716 ****
  786.   {
  787.     if (flag_pic && symbolic_operand (operands[1], SImode)) 
  788.       {
  789. !       /* The source is an address which requires PIC relocation.  
  790. !          Call legitimize_pic_address with the source, mode, and a relocation
  791. !          register (a new pseudo, or the final destination if reload_in_progress
  792. !          is set).   Then fall through normally */
  793. !       extern rtx legitimize_pic_address();
  794. !       rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
  795. !       operands[1] = legitimize_pic_address (operands[1], SImode, temp);
  796.       }
  797.   }")
  798.   
  799. --- 704,721 ----
  800.   {
  801.     if (flag_pic && symbolic_operand (operands[1], SImode)) 
  802.       {
  803. ! #ifdef LEGITIMATE_BASEREL_OPERAND_P
  804. !       if (flag_pic != 3 || !LEGITIMATE_BASEREL_OPERAND_P (operands[1]))
  805. ! #endif
  806. !       {
  807. !         /* The source is an address which requires PIC relocation.  
  808. !            Call legitimize_pic_address with the source, mode, and a relocation
  809. !            register (a new pseudo, or the final destination if reload_in_progress
  810. !            is set).   Then fall through normally */
  811. !         extern rtx legitimize_pic_address();
  812. !         rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
  813. !         operands[1] = legitimize_pic_address (operands[1], SImode, temp);
  814. !       }
  815.       }
  816.   }")
  817.   
  818. ***************
  819. *** 4651,4657 ****
  820.     ""
  821.     "
  822.   {
  823. !   if (flag_pic && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
  824.       operands[0] = gen_rtx (MEM, GET_MODE (operands[0]),
  825.                  force_reg (Pmode, XEXP (operands[0], 0)));
  826.   }")
  827. --- 4656,4662 ----
  828.     ""
  829.     "
  830.   {
  831. !   if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
  832.       operands[0] = gen_rtx (MEM, GET_MODE (operands[0]),
  833.                  force_reg (Pmode, XEXP (operands[0], 0)));
  834.   }")
  835. ***************
  836. *** 4662,4668 ****
  837.        (match_operand:SI 1 "general_operand" "g"))]
  838.     ;; Operand 1 not really used on the m68000.
  839.   
  840. !   "! flag_pic"
  841.     "*
  842.   #ifdef MOTOROLA
  843.     return \"jsr %0\";
  844. --- 4667,4673 ----
  845.        (match_operand:SI 1 "general_operand" "g"))]
  846.     ;; Operand 1 not really used on the m68000.
  847.   
  848. !   "(! flag_pic || flag_pic == 3)"
  849.     "*
  850.   #ifdef MOTOROLA
  851.     return \"jsr %0\";
  852. ***************
  853. *** 4677,4683 ****
  854.        (match_operand:SI 1 "general_operand" "g"))]
  855.     ;; Operand 1 not really used on the m68000.
  856.   
  857. !   "flag_pic"
  858.     "*
  859.     return \"jsr %0\";
  860.   ")
  861. --- 4682,4688 ----
  862.        (match_operand:SI 1 "general_operand" "g"))]
  863.     ;; Operand 1 not really used on the m68000.
  864.   
  865. !   "(flag_pic && flag_pic < 3)"
  866.     "*
  867.     return \"jsr %0\";
  868.   ")
  869. ***************
  870. *** 4693,4699 ****
  871.     ""
  872.     "
  873.   {
  874. !   if (flag_pic && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
  875.       operands[1] = gen_rtx (MEM, GET_MODE (operands[1]),
  876.                  force_reg (Pmode, XEXP (operands[1], 0)));
  877.   }")
  878. --- 4698,4704 ----
  879.     ""
  880.     "
  881.   {
  882. !   if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
  883.       operands[1] = gen_rtx (MEM, GET_MODE (operands[1]),
  884.                  force_reg (Pmode, XEXP (operands[1], 0)));
  885.   }")
  886. ***************
  887. *** 4704,4710 ****
  888.       (call (match_operand:QI 1 "memory_operand" "o")
  889.             (match_operand:SI 2 "general_operand" "g")))]
  890.     ;; Operand 2 not really used on the m68000.
  891. !   "! flag_pic"
  892.     "*
  893.   #ifdef MOTOROLA
  894.     return \"jsr %1\";
  895. --- 4709,4715 ----
  896.       (call (match_operand:QI 1 "memory_operand" "o")
  897.             (match_operand:SI 2 "general_operand" "g")))]
  898.     ;; Operand 2 not really used on the m68000.
  899. !   "(! flag_pic || flag_pic == 3)"
  900.     "*
  901.   #ifdef MOTOROLA
  902.     return \"jsr %1\";
  903. ***************
  904. *** 4719,4725 ****
  905.       (call (match_operand:QI 1 "memory_operand" "o")
  906.             (match_operand:SI 2 "general_operand" "g")))]
  907.     ;; Operand 2 not really used on the m68000.
  908. !   "flag_pic"
  909.     "*
  910.     return \"jsr %1\";
  911.   ")
  912. --- 4724,4730 ----
  913.       (call (match_operand:QI 1 "memory_operand" "o")
  914.             (match_operand:SI 2 "general_operand" "g")))]
  915.     ;; Operand 2 not really used on the m68000.
  916. !   "(flag_pic && flag_pic < 3)"
  917.     "*
  918.     return \"jsr %1\";
  919.   ")
  920. diff -c -r ngcc/cp-tree.c gcc/cp-tree.c
  921. *** ngcc/cp-tree.c    Mon Nov 30 15:34:32 1992
  922. --- gcc/cp-tree.c    Mon Dec 28 00:27:36 1992
  923. ***************
  924. *** 1698,1703 ****
  925. --- 1698,1704 ----
  926.     print_class_statistics ();
  927.   }
  928.   
  929. + #ifndef atarist
  930.   /* This is used by the `assert' macro.  It is provided in libgcc.a,
  931.      which `cc' doesn't know how to link.  Note that the C++ front-end
  932.      no longer actually uses the `assert' macro (instead, it calls
  933. ***************
  934. *** 1720,1725 ****
  935. --- 1721,1727 ----
  936.     fflush (stderr);
  937.     abort ();
  938.   }
  939. + #endif
  940.   
  941.   /* Return, as an INTEGER_CST node, the number of elements for
  942.      TYPE (which is an ARRAY_TYPE).  This counts only elements of the top array. */
  943. diff -c -r ngcc/expr.c gcc/expr.c
  944. *** ngcc/expr.c    Mon Nov 30 15:34:53 1992
  945. --- gcc/expr.c    Mon Dec 28 00:27:39 1992
  946. ***************
  947. *** 1977,1982 ****
  948. --- 1977,1988 ----
  949.   
  950.     argvec = (struct arg *) alloca (nargs * sizeof (struct arg));
  951.   
  952. + /* how would you do this RIGHT ?? fake a DECL node? dunno... */
  953. + #ifdef ENCODE_SECTION_INFO
  954. +   /* mark it as a function (to be in the text section that is) */
  955. +   SYMBOL_REF_FLAG (fun) = 1;
  956. + #endif
  957.     INIT_CUMULATIVE_ARGS (args_so_far, (tree)0, fun);
  958.   
  959.     args_size.constant = 0;
  960. diff -c -r ngcc/final.c gcc/final.c
  961. *** ngcc/final.c    Mon Nov 30 15:35:01 1992
  962. --- gcc/final.c    Mon Dec 28 00:27:42 1992
  963. ***************
  964. *** 67,74 ****
  965. --- 67,78 ----
  966.   #if defined (USG) || defined (NO_STAB_H)
  967.   #include "gstab.h"  /* If doing DBX on sysV, use our own stab.h.  */
  968.   #else
  969. + #if defined(CROSSATARI) || defined(atarist) || defined(atariminix)
  970. + #include "astab.h"
  971. + #else
  972.   #include <stab.h>  /* On BSD, use the system's stab.h.  */
  973.   #endif /* not USG */
  974. + #endif /* not atari */
  975.   #endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */
  976.   
  977.   #ifdef XCOFF_DEBUGGING_INFO
  978. diff -c -r ngcc/fold-const.c gcc/fold-const.c
  979. *** ngcc/fold-const.c    Mon Nov 30 15:35:07 1992
  980. --- gcc/fold-const.c    Mon Dec 28 00:27:45 1992
  981. ***************
  982. *** 62,68 ****
  983.   #define left_shift_overflows(a, b)  ((a)  !=  ((a) << (b)) >> (b))
  984.   
  985.   /* Yield nonzero if A and B have the same sign.  */
  986. ! #define same_sign(a, b) ((a) ^ (b) >= 0)
  987.   
  988.   /* Suppose A1 + B1 = SUM1, using 2's complement arithmetic ignoring overflow.
  989.      Suppose A, B and SUM have the same respective signs as A1, B1, and SUM1.
  990. --- 62,68 ----
  991.   #define left_shift_overflows(a, b)  ((a)  !=  ((a) << (b)) >> (b))
  992.   
  993.   /* Yield nonzero if A and B have the same sign.  */
  994. ! #define same_sign(a, b) (((a) ^ (b)) >= 0)
  995.   
  996.   /* Suppose A1 + B1 = SUM1, using 2's complement arithmetic ignoring overflow.
  997.      Suppose A, B and SUM have the same respective signs as A1, B1, and SUM1.
  998. diff -c -r ngcc/gcc.c gcc/gcc.c
  999. *** ngcc/gcc.c    Mon Dec 28 00:44:57 1992
  1000. --- gcc/gcc.c    Mon Dec 28 00:27:50 1992
  1001. ***************
  1002. *** 30,35 ****
  1003. --- 30,44 ----
  1004.   Once it knows which kind of compilation to perform, the procedure for
  1005.   compilation is specified by a string called a "spec".  */
  1006.   
  1007. + #ifdef CROSSATARI
  1008. + #ifdef atarist
  1009. + #undef atarist
  1010. + #endif
  1011. + #ifdef atariminix
  1012. + #undef atariminix
  1013. + #endif
  1014. + #endif
  1015. +   
  1016.   #include <sys/types.h>
  1017.   #include <ctype.h>
  1018.   #include <signal.h>
  1019. ***************
  1020. *** 40,45 ****
  1021. --- 49,57 ----
  1022.   #include "obstack.h"
  1023.   #include "gvarargs.h"
  1024.   #include <stdio.h>
  1025. + #ifdef CROSSATARI
  1026. + #include <ctype.h>
  1027. + #endif
  1028.   
  1029.   #ifndef R_OK
  1030.   #define R_OK 4
  1031. ***************
  1032. *** 65,71 ****
  1033.   #define NULL_PTR ((GENERIC_PTR)0)
  1034.   #endif
  1035.   
  1036. ! #ifdef USG
  1037.   #define vfork fork
  1038.   #endif /* USG */
  1039.   
  1040. --- 77,83 ----
  1041.   #define NULL_PTR ((GENERIC_PTR)0)
  1042.   #endif
  1043.   
  1044. ! #if (defined(USG) || defined(atariminix))
  1045.   #define vfork fork
  1046.   #endif /* USG */
  1047.   
  1048. ***************
  1049. *** 97,102 ****
  1050. --- 109,121 ----
  1051.   #define PATH_SEPARATOR ':'
  1052.   #endif
  1053.   
  1054. + #ifdef atarist
  1055. + #include <osbind.h>
  1056. + #include <ctype.h>
  1057. + #include <fcntl.h>        /* fgth, for redirection of stderr */
  1058. + long _stksize = 8192;
  1059. + #endif
  1060.   #define obstack_chunk_alloc xmalloc
  1061.   #define obstack_chunk_free free
  1062.   
  1063. ***************
  1064. *** 153,159 ****
  1065. --- 172,180 ----
  1066.      pass the compiler in building the list of pointers to constructors
  1067.      and destructors.  */
  1068.   
  1069. + #if (!(defined(CROSSATARI) || defined(atarist)))
  1070.   static struct obstack collect_obstack;
  1071. + #endif
  1072.   
  1073.   extern char *version_string;
  1074.   
  1075. ***************
  1076. *** 445,451 ****
  1077.              %{aux-info*}\
  1078.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1079.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1080. !               %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1081.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1082.                         %{!pipe:%g.s} %A\n }}}}"},
  1083.     {"-",
  1084. --- 466,472 ----
  1085.              %{aux-info*}\
  1086.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1087.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1088. !               %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1089.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1090.                         %{!pipe:%g.s} %A\n }}}}"},
  1091.     {"-",
  1092. ***************
  1093. *** 478,484 ****
  1094.              %{aux-info*}\
  1095.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1096.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1097. !               %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1098.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1099.                         %{!pipe:%g.s} %A\n }}}}"},
  1100.     {".h", "@c-header"},
  1101. --- 499,505 ----
  1102.              %{aux-info*}\
  1103.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1104.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1105. !               %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1106.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1107.                         %{!pipe:%g.s} %A\n }}}}"},
  1108.     {".h", "@c-header"},
  1109. ***************
  1110. *** 513,519 ****
  1111.              %{aux-info*}\
  1112.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1113.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1114. !               %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1115.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1116.                         %{!pipe:%g.s} %A\n }}}}"},
  1117.     {".i", "@cpp-output"},
  1118. --- 534,540 ----
  1119.              %{aux-info*}\
  1120.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1121.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1122. !               %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1123.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1124.                         %{!pipe:%g.s} %A\n }}}}"},
  1125.     {".i", "@cpp-output"},
  1126. ***************
  1127. *** 524,530 ****
  1128.       %{aux-info*}\
  1129.       %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1130.       %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1131. !     %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1132.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o} %{!pipe:%g.s} %A\n }"},
  1133.     {".ii", "@c++-cpp-output"},
  1134.     {"@c++-cpp-output",
  1135. --- 545,551 ----
  1136.       %{aux-info*}\
  1137.       %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1138.       %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1139. !     %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1140.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o} %{!pipe:%g.s} %A\n }"},
  1141.     {".ii", "@c++-cpp-output"},
  1142.     {"@c++-cpp-output",
  1143. ***************
  1144. *** 534,547 ****
  1145.           %{aux-info*}\
  1146.           %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1147.           %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1148. !        %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1149.              %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1150.              %{!pipe:%g.s} %A\n }"},
  1151.     {".s", "@assembler"},
  1152.     {"@assembler",
  1153. !    "%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1154.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o} %i %A\n }"},
  1155.     {".S", "@assembler-with-cpp"},
  1156.     {"@assembler-with-cpp",
  1157.      "cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
  1158.       %{C:%{!E:%eGNU C does not support -C without using -E}}\
  1159. --- 555,571 ----
  1160.           %{aux-info*}\
  1161.           %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1162.           %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1163. !        %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1164.              %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1165.              %{!pipe:%g.s} %A\n }"},
  1166.     {".s", "@assembler"},
  1167.     {"@assembler",
  1168. !    "%{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1169.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o} %i %A\n }"},
  1170.     {".S", "@assembler-with-cpp"},
  1171. +   {".ss", "@assembler-with-cpp"},
  1172. +   {".cpp", "@assembler-with-cpp"},
  1173. +   {".spp", "@assembler-with-cpp"},
  1174.     {"@assembler-with-cpp",
  1175.      "cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
  1176.       %{C:%{!E:%eGNU C does not support -C without using -E}}\
  1177. ***************
  1178. *** 551,557 ****
  1179.           %{traditional-cpp:-traditional}\
  1180.       %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*}\
  1181.           %i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
  1182. !    "%{!M:%{!MM:%{!E:%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1183.                       %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1184.               %{!pipe:%g.s} %A\n }}}}"},
  1185.     /* Mark end of table */
  1186. --- 575,581 ----
  1187.           %{traditional-cpp:-traditional}\
  1188.       %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*}\
  1189.           %i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
  1190. !    "%{!M:%{!MM:%{!E:%{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1191.                       %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1192.               %{!pipe:%g.s} %A\n }}}}"},
  1193.     /* Mark end of table */
  1194. ***************
  1195. *** 565,570 ****
  1196. --- 589,602 ----
  1197.   
  1198.   /* Here is the spec for running the linker, after compiling all files.  */
  1199.   
  1200. + #if (defined(CROSSATARI) || defined(atarist) || defined(atariminix))
  1201. + static char *link_command_spec = 
  1202. +  "%{!c:%{!M*:%{!E:%{!S:ld %X %{v} %{G} %{o*} %l\
  1203. +  %{A} %{d} %{e*} %{N} %{n} %{r} %{s} %{S} %{T*} %{t} %{u*} %{X} %{x} %{z}\
  1204. +  %{y*} %{!nostdlib:%S} \
  1205. +  %{L*} %o %{!nostdlib:%s %L}\n }}}}";
  1206. + #else
  1207.   /* -u* was put back because both BSD and SysV seem to support it.  */
  1208.   /* %{static:} simply prevents an error message if the target machine
  1209.      doesn't handle -static.  */
  1210. ***************
  1211. *** 592,597 ****
  1212. --- 624,630 ----
  1213.               %{L*} %D %o %{!nostdlib:-lgcc %L -lgcc %{!A:%E}}\n }}}}}";
  1214.   #endif
  1215.   #endif
  1216. + #endif
  1217.   
  1218.   /* A vector of options to give to the linker.
  1219.      These options are accumulated by -Xlinker and -Wl,
  1220. ***************
  1221. *** 605,610 ****
  1222. --- 638,644 ----
  1223.   static int n_assembler_options;
  1224.   static char **assembler_options;
  1225.   
  1226. + #if (!(defined(atarist) || defined(CROSSATARI) || defined(atariminix)))
  1227.   /* Read compilation specs from a file named FILENAME,
  1228.      replacing the default ones.
  1229.   
  1230. ***************
  1231. *** 743,748 ****
  1232. --- 777,783 ----
  1233.   
  1234.     return p;
  1235.   }
  1236. + #endif /* ataris */
  1237.   
  1238.   /* Structure to keep track of the specs that have been defined so far.  These
  1239.      are accessed using %(specname) or %[specname] in a compiler or link spec. */
  1240. ***************
  1241. *** 859,864 ****
  1242. --- 894,906 ----
  1243.   /* Name with which this program was invoked.  */
  1244.   
  1245.   static char *programname;
  1246. + #ifdef atarist
  1247. + /* Flag indicating, that stderr should be redirected for the child
  1248. +    processes */
  1249. + unsigned char zflag;
  1250. + #endif
  1251.   
  1252.   /* Structures to keep track of prefixes to try when looking for files. */
  1253.   
  1254. ***************
  1255. *** 1115,1122 ****
  1256.   static void
  1257.   choose_temp_base ()
  1258.   {
  1259. -   char *base = getenv ("TMPDIR");
  1260.     int len;
  1261.   
  1262.     if (base == (char *)0)
  1263.       {
  1264. --- 1157,1181 ----
  1265.   static void
  1266.   choose_temp_base ()
  1267.   {
  1268.     int len;
  1269. + #if (!(defined(atarist) || defined(atariminix)))
  1270. +   char *base = getenv ("TMPDIR");
  1271. + #else
  1272. +   char *base = getenv ("TEMP");
  1273. +   if(base == (char *)0)
  1274. +   {
  1275. +       base = getenv("TMPDIR");
  1276. +       if(base == (char *)0)
  1277. +       base = getenv("TMP");
  1278. +   }
  1279. +   if(base != (char *)0)
  1280. +   {
  1281. +       char *newbase = alloca(FILENAME_MAX);
  1282. +       dos2unx(base,newbase);
  1283. +       base = newbase;
  1284. +   }
  1285. + #endif
  1286.   
  1287.     if (base == (char *)0)
  1288.       {
  1289. ***************
  1290. *** 1136,1142 ****
  1291.     len = strlen (base);
  1292.     temp_filename = xmalloc (len + sizeof("/ccXXXXXX"));
  1293.     strcpy (temp_filename, base);
  1294. !   if (len > 0 && temp_filename[len-1] != '/')
  1295.       temp_filename[len++] = '/';
  1296.     strcpy (temp_filename + len, "ccXXXXXX");
  1297.   
  1298. --- 1195,1205 ----
  1299.     len = strlen (base);
  1300.     temp_filename = xmalloc (len + sizeof("/ccXXXXXX"));
  1301.     strcpy (temp_filename, base);
  1302. !   if (len > 0 && (temp_filename[len-1] != '/' 
  1303. ! #ifdef atarist
  1304. !           || temp_filename[len-1] != '\\'
  1305. ! #endif
  1306. !            ))
  1307.       temp_filename[len++] = '/';
  1308.     strcpy (temp_filename + len, "ccXXXXXX");
  1309.   
  1310. ***************
  1311. *** 1155,1160 ****
  1312. --- 1218,1224 ----
  1313.      use come from an obstack, we don't have to worry about allocating
  1314.      space for them.  */
  1315.   
  1316. + #if (!(defined(CROSSATARI) || defined(atarist)))
  1317.   #ifndef HAVE_PUTENV
  1318.   
  1319.   putenv (str)
  1320. ***************
  1321. *** 1249,1254 ****
  1322. --- 1313,1319 ----
  1323.     obstack_grow (&collect_obstack, "\0", 1);
  1324.     putenv (obstack_finish (&collect_obstack));
  1325.   }
  1326. + #endif /* ataris */
  1327.   
  1328.   
  1329.   /* Search for NAME using the prefix list PREFIXES.  MODE is passed to
  1330. ***************
  1331. *** 1524,1529 ****
  1332. --- 1589,1595 ----
  1333.   
  1334.   #else /* not __MSDOS__ */
  1335.   
  1336. + #ifndef atarist
  1337.   static int
  1338.   pexecute (search_flag, program, argv, not_last)
  1339.        int search_flag;
  1340. ***************
  1341. *** 1612,1617 ****
  1342. --- 1678,1684 ----
  1343.       }
  1344.   }
  1345.   
  1346. + #endif /* not atarist */
  1347.   #endif /* not __MSDOS__ */
  1348.   #else /* not OS2 */
  1349.   
  1350. ***************
  1351. *** 1642,1657 ****
  1352.       {
  1353.         char *prog;        /* program name.  */
  1354.         char **argv;        /* vector of args.  */
  1355.         int pid;            /* pid of process for this command.  */
  1356.       };
  1357.   
  1358.     struct command *commands;    /* each command buffer with above info.  */
  1359.   
  1360.     /* Count # of piped commands.  */
  1361.     for (n_commands = 1, i = 0; i < argbuf_index; i++)
  1362.       if (strcmp (argbuf[i], "|") == 0)
  1363.         n_commands++;
  1364.     /* Get storage for each command.  */
  1365.     commands
  1366.       = (struct command *) alloca (n_commands * sizeof (struct command));
  1367. --- 1709,1729 ----
  1368.       {
  1369.         char *prog;        /* program name.  */
  1370.         char **argv;        /* vector of args.  */
  1371. + #ifndef atarist
  1372.         int pid;            /* pid of process for this command.  */
  1373. + #endif
  1374.       };
  1375.   
  1376.     struct command *commands;    /* each command buffer with above info.  */
  1377.   
  1378. + #ifndef atarist
  1379.     /* Count # of piped commands.  */
  1380.     for (n_commands = 1, i = 0; i < argbuf_index; i++)
  1381.       if (strcmp (argbuf[i], "|") == 0)
  1382.         n_commands++;
  1383. ! #else
  1384. !   n_commands = 1;
  1385. ! #endif
  1386.     /* Get storage for each command.  */
  1387.     commands
  1388.       = (struct command *) alloca (n_commands * sizeof (struct command));
  1389. ***************
  1390. *** 1666,1671 ****
  1391. --- 1738,1744 ----
  1392.     if (string)
  1393.       commands[0].argv[0] = string;
  1394.   
  1395. + #ifndef atarist
  1396.     for (n_commands = 1, i = 0; i < argbuf_index; i++)
  1397.       if (strcmp (argbuf[i], "|") == 0)
  1398.         {                /* each command.  */
  1399. ***************
  1400. *** 1680,1685 ****
  1401. --- 1753,1761 ----
  1402.         commands[n_commands].argv[0] = string;
  1403.       n_commands++;
  1404.         }
  1405. + #else
  1406. +   n_commands = 1;
  1407. + #endif
  1408.   
  1409.     argbuf[argbuf_index] = 0;
  1410.   
  1411. ***************
  1412. *** 1695,1703 ****
  1413. --- 1771,1781 ----
  1414.         for (j = commands[i].argv; *j; j++)
  1415.           fprintf (stderr, " %s", *j);
  1416.   
  1417. + #ifndef atarist
  1418.         /* Print a pipe symbol after all but the last command.  */
  1419.         if (i + 1 != n_commands)
  1420.           fprintf (stderr, " |");
  1421. + #endif
  1422.         fprintf (stderr, "\n");
  1423.       }
  1424.         fflush (stderr);
  1425. ***************
  1426. *** 1712,1722 ****
  1427. --- 1790,1802 ----
  1428.   #endif /* DEBUG */
  1429.       }
  1430.   
  1431. + #ifndef atarist
  1432.     /* Run each piped subprocess.  */
  1433.   
  1434.     last_pipe_input = STDIN_FILE_NO;
  1435.     for (i = 0; i < n_commands; i++)
  1436.       {
  1437. + #ifndef atariminix
  1438.         char *string = commands[i].argv[0];
  1439.   
  1440.         commands[i].pid = pexecute (string != commands[i].prog,
  1441. ***************
  1442. *** 1723,1728 ****
  1443. --- 1803,1816 ----
  1444.                     string, commands[i].argv,
  1445.                     i + 1 < n_commands);
  1446.   
  1447. + #else
  1448. +       extern int execv();
  1449. +       char *string = commands[i].argv[0];
  1450. +       commands[i].pid = pexecute (execv,
  1451. +                   string, commands[i].argv,
  1452. +                   i + 1 < n_commands);
  1453. + #endif
  1454.         if (string != commands[i].prog)
  1455.       free (string);
  1456.       }
  1457. ***************
  1458. *** 1769,1774 ****
  1459. --- 1857,1907 ----
  1460.         }
  1461.       return ret_code;
  1462.     }
  1463. + #else /* atarist */
  1464. +  {
  1465. +      register int iii;
  1466. +      int errfd, oldfd;
  1467. +      char **j;
  1468. +      execution_count++;
  1469. +      if (zflag)
  1470. +        {
  1471. +      errfd = Fopen("compile.err", 2);
  1472. +      if (errfd < __SMALLEST_VALID_HANDLE)
  1473. +        errfd = Fcreate("compile.err", 0);
  1474. +      else
  1475. +        Fseek(0L, errfd, 2);
  1476. +      if (errfd >= __SMALLEST_VALID_HANDLE)
  1477. +        {
  1478. +          oldfd = Fdup (2);
  1479. +          Fforce(2, errfd);
  1480. +        }
  1481. +      else
  1482. +        {
  1483. +          error("cannot open %s", "compile.err");
  1484. +          zflag = 0;        /* no redirection */
  1485. +        }
  1486. +        }
  1487. +      for (i = 0; i < n_commands ; i++)
  1488. +      {
  1489. +          j = commands[i].argv;
  1490. +          iii = spawnve(0, j[0], j, NULL);
  1491. +      if(iii != 0)
  1492. +          break;
  1493. +      }
  1494. +      if (zflag)
  1495. +        {
  1496. +      Fforce(2, oldfd);
  1497. +      Fclose(oldfd);
  1498. +      Fclose(errfd);
  1499. +        }
  1500. +      if (iii != 0)
  1501. +        return -1;
  1502. +      else
  1503. +        return 0;
  1504. +  }
  1505. + #endif /* atarist */  
  1506.   }
  1507.   
  1508.   /* Find all the switches given to us
  1509. ***************
  1510. *** 1832,1837 ****
  1511. --- 1965,1971 ----
  1512.   
  1513.     /* Set up the default search paths.  */
  1514.   
  1515. + #ifndef CROSSATARI
  1516.     if (gcc_exec_prefix)
  1517.       {
  1518.         add_prefix (&exec_prefix, gcc_exec_prefix, 0, 0, NULL_PTR);
  1519. ***************
  1520. *** 1908,1913 ****
  1521. --- 2042,2048 ----
  1522.           endp++;
  1523.       }
  1524.       }
  1525. + #endif /* CROSSATARI */
  1526.   
  1527.     /* Use LPATH like LIBRARY_PATH (for the CMU build program).  */
  1528.     temp = getenv ("LPATH");
  1529. ***************
  1530. *** 2115,2120 ****
  1531. --- 2250,2261 ----
  1532.             n_switches++;
  1533.             break;
  1534.           }
  1535. + #ifdef atarist
  1536. +         case 'z':    /* redirect stderr to a file */
  1537. +           zflag++;
  1538. +           n_switches++;
  1539. +           break;
  1540. + #endif
  1541.           default:
  1542.             n_switches++;
  1543.   
  1544. ***************
  1545. *** 2134,2144 ****
  1546. --- 2275,2296 ----
  1547.        (such as cpp) rather than those of the host system.  */
  1548.     /* Use 2 as fourth arg meaning try just the machine as a suffix,
  1549.        as well as trying the machine and the version.  */
  1550. + #if (defined(atarist) || defined(CROSSATARI) || defined(WEIRD))
  1551. + /* NB defined(WEIRD) should not really be there, its only for my weird setup */
  1552. +   /* We are not using machine_suffix here, so do not make */
  1553. +   /* these prefixes available only when we have one       */
  1554. +   add_prefix (&exec_prefix, standard_exec_prefix, 0, 0, NULL_PTR);
  1555. +   add_prefix (&exec_prefix, standard_exec_prefix_1, 0, 0, NULL_PTR);
  1556. +   add_prefix (&startfile_prefix, standard_exec_prefix, 0, 0, NULL_PTR);
  1557. +   add_prefix (&startfile_prefix, standard_exec_prefix_1, 0, 0, NULL_PTR);
  1558. + #else
  1559.     add_prefix (&exec_prefix, standard_exec_prefix, 0, 2, NULL_PTR);
  1560.     add_prefix (&exec_prefix, standard_exec_prefix_1, 0, 2, NULL_PTR);
  1561.   
  1562.     add_prefix (&startfile_prefix, standard_exec_prefix, 0, 1, NULL_PTR);
  1563.     add_prefix (&startfile_prefix, standard_exec_prefix_1, 0, 1, NULL_PTR);
  1564. + #endif /* (defined(atarist) || defined(CROSSATARI)) */
  1565.   
  1566.     /* More prefixes are enabled in main, after we read the specs file
  1567.        and determine whether this is cross-compilation or not.  */
  1568. ***************
  1569. *** 2306,2311 ****
  1570. --- 2458,2472 ----
  1571.      search dirs for it.  */
  1572.   static int this_is_library_file;
  1573.   
  1574. + #ifdef atarist
  1575. + /* I don't know why this is necessary.  Recursive calls to do_spec_1
  1576. +    end up ignoring the error code from calls to execute().  That causes
  1577. +    do_spec to get a 0 return value, and do_spec_1("\n"), which causes the
  1578. +    command to get executed again.
  1579. + */
  1580. + int execute_return_error = 0;
  1581. + #endif
  1582.   /* Process the spec SPEC and run the commands specified therein.
  1583.      Returns 0 if the spec is successfully processed; -1 if failed.  */
  1584.   
  1585. ***************
  1586. *** 2325,2334 ****
  1587. --- 2486,2504 ----
  1588.   
  1589.     /* Force out any unfinished command.
  1590.        If -pipe, this forces out the last command if it ended in `|'.  */
  1591. + #ifdef atarist
  1592. +   if (!value && execute_return_error)
  1593. +     {
  1594. +     value = execute_return_error;
  1595. +     execute_return_error = 0;
  1596. +     }
  1597. + #endif
  1598.     if (value == 0)
  1599.       {
  1600. + #ifndef atarist
  1601.         if (argbuf_index > 0 && !strcmp (argbuf[argbuf_index - 1], "|"))
  1602.       argbuf_index--;
  1603. + #endif
  1604.   
  1605.         if (argbuf_index > 0)
  1606.       value = execute ();
  1607. ***************
  1608. *** 2365,2370 ****
  1609. --- 2535,2591 ----
  1610.          Otherwise, NL, SPC, TAB and % are special.  */
  1611.       switch (inswitch ? 'a' : c)
  1612.         {
  1613. + #if (defined(atarist) || defined(CROSSATARI))
  1614. + /* this stuff added by jrd.  if see '$', expect name of env var, delimited
  1615. +    by '$'.  Find it's value, and subst it in.
  1616. +    modified by ERS to only collect things that look like names; this
  1617. +    saves e.g. the -$ arg. to cpp from getting munged */
  1618. +       case '$':
  1619. +       {
  1620. +     char varname[32];        /* should be enough */
  1621. +     char * value;            /* deciphered value string */
  1622. +     char *temp;
  1623. +     int i;
  1624. +     extern char *getenv(), *index();
  1625. +     
  1626. +     for (i = 0 ; ((c = *p) != '$') && isalnum(c) && i < 31 ; i++, p++)
  1627. +         varname[i] = c;
  1628. +     varname[i] = '\0';
  1629. +     if (strlen(varname) > 0) /* ++jrb fix */
  1630. +     {
  1631. +                  ++p;    /* skip trailing '$' */
  1632. +         value = getenv(varname); /* ++jrb fix */
  1633. +         if (value)
  1634. +         { /* if value is a path, only consider 1'st component */
  1635. + #ifdef atarist
  1636. +             if((temp = index(value, ',')) == NULL)
  1637. +                 temp = index(value, ';');
  1638. + #else
  1639. +             temp = index(value, ':');
  1640. + #endif
  1641. +             if(temp != NULL)
  1642. +             {
  1643. +                 char *t = (char *) alloca(strlen(value) + 1);
  1644. +                 strcpy(t, value);
  1645. +                 t[temp-value] = '\0';
  1646. +                 do_spec_1(t, 0);
  1647. +             }
  1648. +             else
  1649. +                 do_spec_1(value, 0);
  1650. +         }
  1651. +             else
  1652. +             do_spec_1(".", 0);    /* a compleat kludge... */
  1653. +     }
  1654. +         else
  1655. +         {
  1656. +              obstack_1grow(&obstack, '$');
  1657. +              arg_going = 1;
  1658. +         }
  1659. +       }
  1660. +      break;
  1661. + #endif /* atarist */
  1662.         case '\n':
  1663.       /* End of line: finish any pending argument,
  1664.          then run the pending command if one has been started.  */
  1665. ***************
  1666. *** 2402,2407 ****
  1667. --- 2623,2632 ----
  1668.       if (argbuf_index > 0)
  1669.         {
  1670.           int value = execute ();
  1671. + #ifdef atarist
  1672. +         if (!execute_return_error)
  1673. +             execute_return_error = value;
  1674. + #endif
  1675.           if (value)
  1676.             return value;
  1677.         }
  1678. ***************
  1679. *** 2985,2997 ****
  1680. --- 3210,3230 ----
  1681.           break;
  1682.   
  1683.         default:
  1684. + #if 1 /* atarist */
  1685. +         fprintf(stderr, "Bogus char '%c' found at pos %d of spec '%s'\n",
  1686. +         c, (p - spec - 1), spec);
  1687. + #endif
  1688.           abort ();
  1689.         }
  1690.       break;
  1691.   
  1692. + #ifndef atarist
  1693. +       /* on the atari it is important to preserve backslash in spec */
  1694. +       /* so just let it go into default case */
  1695.         case '\\':
  1696.       /* Backslash: treat next character as ordinary.  */
  1697.       c = *p++;
  1698. + #endif
  1699.   
  1700.       /* fall through */
  1701.         default:
  1702. ***************
  1703. *** 3259,3264 ****
  1704. --- 3492,3498 ----
  1705.   
  1706.   /* On fatal signals, delete all the temporary files.  */
  1707.   
  1708. + #ifndef atarist
  1709.   static void
  1710.   fatal_error (signum)
  1711.        int signum;
  1712. ***************
  1713. *** 3270,3275 ****
  1714. --- 3504,3510 ----
  1715.        so its normal effect occurs.  */
  1716.     kill (getpid (), signum);
  1717.   }
  1718. + #endif
  1719.   
  1720.   int
  1721.   main (argc, argv)
  1722. ***************
  1723. *** 3284,3289 ****
  1724. --- 3519,3529 ----
  1725.     char *explicit_link_files;
  1726.     char *specs_file;
  1727.   
  1728. + #ifdef atarist
  1729. + /* turn this on if you are going to set the TOS 1.4 dont clear heap flag */
  1730. + /*  _malloczero(1); */     /* zero mallocs by default */
  1731. +   programname = "gcc";
  1732. + #else  
  1733.     programname = argv[0];
  1734.   
  1735.     if (signal (SIGINT, SIG_IGN) != SIG_IGN)
  1736. ***************
  1737. *** 3296,3301 ****
  1738. --- 3536,3542 ----
  1739.     if (signal (SIGPIPE, SIG_IGN) != SIG_IGN)
  1740.       signal (SIGPIPE, fatal_error);
  1741.   #endif
  1742. + #endif /* atarist */
  1743.   
  1744.     argbuf_length = 10;
  1745.     argbuf = (char **) xmalloc (argbuf_length * sizeof (char *));
  1746. ***************
  1747. *** 3302,3307 ****
  1748. --- 3543,3549 ----
  1749.   
  1750.     obstack_init (&obstack);
  1751.   
  1752. + #if (!(defined(atarist) || defined(CROSSATARI)))
  1753.     /* Set up to remember the pathname of gcc and any options
  1754.        needed for collect.  */
  1755.     obstack_init (&collect_obstack);
  1756. ***************
  1757. *** 3308,3313 ****
  1758. --- 3550,3556 ----
  1759.     obstack_grow (&collect_obstack, "COLLECT_GCC=", sizeof ("COLLECT_GCC=")-1);
  1760.     obstack_grow (&collect_obstack, programname, strlen (programname)+1);
  1761.     putenv (obstack_finish (&collect_obstack));
  1762. + #endif
  1763.   
  1764.     /* Choose directory for temp files.  */
  1765.   
  1766. ***************
  1767. *** 3319,3324 ****
  1768. --- 3562,3576 ----
  1769.   
  1770.     process_command (argc, argv);
  1771.   
  1772. + #if (defined(atarist) || defined(CROSSATARI))
  1773. +   {
  1774. +     char *temp;
  1775. +     
  1776. +     if((temp = getenv ("GCCEXEC")))
  1777. +     add_prefix (&exec_prefix, temp, 0, 0, 0);
  1778. +   }
  1779. + #endif
  1780. +   
  1781.     /* Initialize the vector of specs to just the default.
  1782.        This means one element containing 0s, as a terminator.  */
  1783.   
  1784. ***************
  1785. *** 3326,3331 ****
  1786. --- 3578,3587 ----
  1787.     bcopy (default_compilers, compilers, sizeof default_compilers);
  1788.     n_compilers = n_default_compilers;
  1789.   
  1790. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  1791. +   specs_file = 0;
  1792. + #else
  1793.     /* Read specs from a file if there is one.  */
  1794.   
  1795.     machine_suffix = concat (spec_machine, "/", concat (spec_version, "/", ""));
  1796. ***************
  1797. *** 3335,3340 ****
  1798. --- 3591,3597 ----
  1799.     /* Read the specs file unless it is a default one.  */
  1800.     if (specs_file != 0 && strcmp (specs_file, "specs"))
  1801.       read_specs (specs_file);
  1802. + #endif
  1803.   
  1804.     /* If not cross-compiling, look for startfiles in the standard places.  */
  1805.     /* The fact that these are done here, after reading the specs file,
  1806. ***************
  1807. *** 3387,3393 ****
  1808. --- 3644,3656 ----
  1809.   
  1810.     if (verbose_flag)
  1811.       {
  1812. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  1813. + #include "PatchLev.h"
  1814. +       fprintf (stderr, "gcc-atariST version %s Patchlevel %s\n",
  1815. +            version_string, PatchLevel);
  1816. + #else
  1817.         fprintf (stderr, "gcc version %s\n", version_string);
  1818. + #endif
  1819.         if (n_infiles == 0)
  1820.       exit (0);
  1821.       }
  1822. ***************
  1823. *** 3435,3441 ****
  1824. --- 3698,3709 ----
  1825.   
  1826.         input_basename = input_filename;
  1827.         for (p = input_filename; *p; p++)
  1828. + #ifdef atarist
  1829. +         if (((*p == '/') || (*p == '\\')) && (*(p-1) != ':'))
  1830. +             /* allow both '\' and '/' with  our new lib */
  1831. + #else
  1832.           if (*p == '/')
  1833. + #endif
  1834.             input_basename = p + 1;
  1835.   
  1836.         /* Find a suffix starting with the last period,
  1837. ***************
  1838. *** 3498,3503 ****
  1839. --- 3766,3772 ----
  1840.         int i;
  1841.         int first_time;
  1842.   
  1843. + #if (!(defined(atarist) || defined(CROSSATARI)))
  1844.         /* Rebuild the COMPILER_PATH and LIBRARY_PATH environment variables
  1845.        for collect.  */
  1846.         putenv_from_prefixes (&exec_prefix, "COMPILER_PATH=");
  1847. ***************
  1848. *** 3528,3533 ****
  1849. --- 3797,3803 ----
  1850.       }
  1851.         obstack_grow (&collect_obstack, "\0", 1);
  1852.         putenv (obstack_finish (&collect_obstack));
  1853. + #endif
  1854.   
  1855.         value = do_spec (link_command_spec);
  1856.         if (value < 0)
  1857. diff -c -r ngcc/getpwd.c gcc/getpwd.c
  1858. *** ngcc/getpwd.c    Mon Dec 28 00:45:00 1992
  1859. --- gcc/getpwd.c    Mon Dec 28 00:27:53 1992
  1860. ***************
  1861. *** 14,20 ****
  1862.      BSD systems) now provides getcwd as called for by POSIX.  Allow for
  1863.      the few exceptions to the general rule here.  */
  1864.   
  1865. ! #if !(defined (POSIX) || defined (USG) || defined (VMS))
  1866.   #include <sys/param.h>
  1867.   extern char *getwd ();
  1868.   #define getcwd(buf,len) getwd(buf)
  1869. --- 14,20 ----
  1870.      BSD systems) now provides getcwd as called for by POSIX.  Allow for
  1871.      the few exceptions to the general rule here.  */
  1872.   
  1873. ! #if !(defined (POSIX) || defined (USG) || defined (VMS) || defined(atarist) || defined(CROSSHPUX))
  1874.   #include <sys/param.h>
  1875.   extern char *getwd ();
  1876.   #define getcwd(buf,len) getwd(buf)
  1877. ***************
  1878. *** 48,58 ****
  1879.     if (!p && !(errno = failure_errno))
  1880.       {
  1881.         if (! ((p = getenv ("PWD")) != 0
  1882.            && *p == '/'
  1883.            && stat (p, &pwdstat) == 0
  1884.            && stat (".", &dotstat) == 0
  1885.            && dotstat.st_ino == pwdstat.st_ino
  1886. !          && dotstat.st_dev == pwdstat.st_dev))
  1887.   
  1888.       /* The shortcut didn't work.  Try the slow, ``sure'' way.  */
  1889.       for (s = GUESSPATHLEN;  ! getcwd (p = xmalloc (s), s);  s *= 2)
  1890. --- 48,61 ----
  1891.     if (!p && !(errno = failure_errno))
  1892.       {
  1893.         if (! ((p = getenv ("PWD")) != 0
  1894. + #ifndef atarist
  1895.            && *p == '/'
  1896.            && stat (p, &pwdstat) == 0
  1897.            && stat (".", &dotstat) == 0
  1898.            && dotstat.st_ino == pwdstat.st_ino
  1899. !          && dotstat.st_dev == pwdstat.st_dev
  1900. ! #endif
  1901. !          ))
  1902.   
  1903.       /* The shortcut didn't work.  Try the slow, ``sure'' way.  */
  1904.       for (s = GUESSPATHLEN;  ! getcwd (p = xmalloc (s), s);  s *= 2)
  1905. diff -c -r ngcc/toplev.c gcc/toplev.c
  1906. *** ngcc/toplev.c    Mon Nov 30 15:36:25 1992
  1907. --- gcc/toplev.c    Mon Dec 28 00:27:55 1992
  1908. ***************
  1909. *** 31,37 ****
  1910.   
  1911.   #include <sys/stat.h>
  1912.   
  1913. ! #ifdef USG
  1914.   #undef FLOAT
  1915.   #include <sys/param.h>
  1916.   /* This is for hpux.  It is a real screw.  They should change hpux.  */
  1917. --- 31,37 ----
  1918.   
  1919.   #include <sys/stat.h>
  1920.   
  1921. ! #if defined(USG) || defined(CROSSHPUX)
  1922.   #undef FLOAT
  1923.   #include <sys/param.h>
  1924.   /* This is for hpux.  It is a real screw.  They should change hpux.  */
  1925. ***************
  1926. *** 41,49 ****
  1927. --- 41,57 ----
  1928.   #undef FFS  /* Some systems define this in param.h.  */
  1929.   #else
  1930.   #ifndef VMS
  1931. + #if (!(defined(atarist) || defined(atariminix)))
  1932.   #include <sys/time.h>
  1933.   #include <sys/resource.h>
  1934. + #endif /* !(atarist || atariminix) */
  1935. + #endif
  1936.   #endif
  1937. + #ifdef atariminix
  1938. + #include <sys/times.h>
  1939. + /* #include <minix/const.h>, avoid dragging this in */
  1940. + #define HZ 60    /* this is the only thing needed from minix/const.h */
  1941.   #endif
  1942.   
  1943.   #include "input.h"
  1944. ***************
  1945. *** 57,62 ****
  1946. --- 65,75 ----
  1947.   #include "xcoffout.h"
  1948.   #endif
  1949.   
  1950. + #ifdef atarist
  1951. + long _stksize = -1L;    /* for all sizes of ST's */
  1952. +     /* -1 means malloc from own heap and keep all  of memory */
  1953. + #endif /* atarist */
  1954.   #ifdef VMS
  1955.   /* The extra parameters substantially improve the I/O performance.  */
  1956.   static FILE *
  1957. ***************
  1958. *** 738,744 ****
  1959.   int
  1960.   get_run_time ()
  1961.   {
  1962. ! #ifdef USG
  1963.     struct tms tms;
  1964.   #else
  1965.   #ifndef VMS
  1966. --- 751,760 ----
  1967.   int
  1968.   get_run_time ()
  1969.   {
  1970. ! #ifdef atarist
  1971. !   long now;
  1972. ! #else
  1973. ! #if (defined(USG) || defined(atariminix) || defined(CROSSHPUX))
  1974.     struct tms tms;
  1975.   #else
  1976.   #ifndef VMS
  1977. ***************
  1978. *** 753,763 ****
  1979.       } vms_times;
  1980.   #endif
  1981.   #endif
  1982.   
  1983.     if (quiet_flag)
  1984.       return 0;
  1985.   
  1986. ! #ifdef USG
  1987.     times (&tms);
  1988.     return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ);
  1989.   #else
  1990. --- 769,783 ----
  1991.       } vms_times;
  1992.   #endif
  1993.   #endif
  1994. + #endif
  1995.   
  1996.     if (quiet_flag)
  1997.       return 0;
  1998.   
  1999. ! #ifdef atarist
  2000. !   return(time(NULL) * 1000000);
  2001. ! #else
  2002. ! #if (defined(USG) || defined(atariminix) || defined(CROSSHPUX))
  2003.     times (&tms);
  2004.     return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ);
  2005.   #else
  2006. ***************
  2007. *** 770,775 ****
  2008. --- 790,796 ----
  2009.     return (vms_times.proc_user_time + vms_times.proc_system_time) * 10000;
  2010.   #endif
  2011.   #endif
  2012. + #endif
  2013.   }
  2014.   
  2015.   #define TIMEVAR(VAR, BODY)    \
  2016. ***************
  2017. *** 1406,1411 ****
  2018. --- 1427,1433 ----
  2019.     longjmp (float_handler, 1);
  2020.   }
  2021.   
  2022. + #ifndef atarist
  2023.   /* Handler for SIGPIPE.  */
  2024.   
  2025.   static void
  2026. ***************
  2027. *** 1415,1420 ****
  2028. --- 1437,1443 ----
  2029.   {
  2030.     fatal ("output pipe has been closed");
  2031.   }
  2032. + #endif
  2033.   
  2034.   /* Strip off a legitimate source ending from the input string NAME of
  2035.      length LEN. */
  2036. ***************
  2037. *** 1446,1451 ****
  2038. --- 1469,1475 ----
  2039.       name[len - 4] = 0;
  2040.   }
  2041.   
  2042. + #ifdef SYSV
  2043.   /* Output a file name in the form wanted by System V.  */
  2044.   
  2045.   void
  2046. ***************
  2047. *** 1474,1479 ****
  2048. --- 1498,1504 ----
  2049.   #endif
  2050.   #endif
  2051.   }
  2052. + #endif
  2053.   
  2054.   /* Compile an entire file of output from cpp, named NAME.
  2055.      Write a file of assembly output and various debugging dumps.  */
  2056. ***************
  2057. *** 1573,1579 ****
  2058. --- 1598,1608 ----
  2059.       {
  2060.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  2061.         strcpy (dumpname, dump_base_name);
  2062. + #ifndef atarist
  2063.         strcat (dumpname, ".jump");
  2064. + #else
  2065. +       strcat (dumpname, ".jmp");
  2066. + #endif
  2067.         jump_opt_dump_file = fopen (dumpname, "w");
  2068.         if (jump_opt_dump_file == 0)
  2069.       pfatal_with_name (dumpname);
  2070. ***************
  2071. *** 1595,1601 ****
  2072. --- 1624,1634 ----
  2073.       {
  2074.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  2075.         strcpy (dumpname, dump_base_name);
  2076. + #ifndef atarist
  2077.         strcat (dumpname, ".loop");
  2078. + #else
  2079. +       strcat (dumpname, ".lop");
  2080. + #endif
  2081.         loop_dump_file = fopen (dumpname, "w");
  2082.         if (loop_dump_file == 0)
  2083.       pfatal_with_name (dumpname);
  2084. ***************
  2085. *** 1606,1612 ****
  2086. --- 1639,1649 ----
  2087.       {
  2088.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  2089.         strcpy (dumpname, dump_base_name);
  2090. + #ifndef atarist
  2091.         strcat (dumpname, ".cse2");
  2092. + #else
  2093. +       strcat (dumpname, ".cs2");
  2094. + #endif
  2095.         cse2_dump_file = fopen (dumpname, "w");
  2096.         if (cse2_dump_file == 0)
  2097.       pfatal_with_name (dumpname);
  2098. ***************
  2099. *** 1617,1623 ****
  2100. --- 1654,1664 ----
  2101.       {
  2102.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  2103.         strcpy (dumpname, dump_base_name);
  2104. + #ifndef atarist
  2105.         strcat (dumpname, ".flow");
  2106. + #else
  2107. +       strcat (dumpname, ".flo");
  2108. + #endif
  2109.         flow_dump_file = fopen (dumpname, "w");
  2110.         if (flow_dump_file == 0)
  2111.       pfatal_with_name (dumpname);
  2112. ***************
  2113. *** 1628,1634 ****
  2114. --- 1669,1679 ----
  2115.       {
  2116.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 10);
  2117.         strcpy (dumpname, dump_base_name);
  2118. + #ifndef atarist
  2119.         strcat (dumpname, ".combine");
  2120. + #else
  2121. +       strcat (dumpname, ".cmb");
  2122. + #endif
  2123.         combine_dump_file = fopen (dumpname, "w");
  2124.         if (combine_dump_file == 0)
  2125.       pfatal_with_name (dumpname);
  2126. ***************
  2127. *** 1639,1645 ****
  2128. --- 1684,1694 ----
  2129.       {
  2130.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 7);
  2131.         strcpy (dumpname, dump_base_name);
  2132. + #ifndef atarist
  2133.         strcat (dumpname, ".sched");
  2134. + #else
  2135. +       strcat (dumpname, ".sch");
  2136. + #endif
  2137.         sched_dump_file = fopen (dumpname, "w");
  2138.         if (sched_dump_file == 0)
  2139.       pfatal_with_name (dumpname);
  2140. ***************
  2141. *** 1650,1656 ****
  2142. --- 1699,1709 ----
  2143.       {
  2144.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  2145.         strcpy (dumpname, dump_base_name);
  2146. + #ifndef atarist
  2147.         strcat (dumpname, ".lreg");
  2148. + #else
  2149. +       strcat (dumpname, ".lrg");
  2150. + #endif
  2151.         local_reg_dump_file = fopen (dumpname, "w");
  2152.         if (local_reg_dump_file == 0)
  2153.       pfatal_with_name (dumpname);
  2154. ***************
  2155. *** 1661,1667 ****
  2156. --- 1714,1724 ----
  2157.       {
  2158.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  2159.         strcpy (dumpname, dump_base_name);
  2160. + #ifndef atarist
  2161.         strcat (dumpname, ".greg");
  2162. + #else
  2163. +       strcat (dumpname, ".grg");
  2164. + #endif
  2165.         global_reg_dump_file = fopen (dumpname, "w");
  2166.         if (global_reg_dump_file == 0)
  2167.       pfatal_with_name (dumpname);
  2168. ***************
  2169. *** 1672,1678 ****
  2170. --- 1729,1739 ----
  2171.       {
  2172.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 8);
  2173.         strcpy (dumpname, dump_base_name);
  2174. + #ifndef atarist
  2175.         strcat (dumpname, ".sched2");
  2176. + #else
  2177. +       strcat (dumpname, ".sc2");
  2178. + #endif
  2179.         sched2_dump_file = fopen (dumpname, "w");
  2180.         if (sched2_dump_file == 0)
  2181.       pfatal_with_name (dumpname);
  2182. ***************
  2183. *** 1683,1689 ****
  2184. --- 1744,1754 ----
  2185.       {
  2186.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 7);
  2187.         strcpy (dumpname, dump_base_name);
  2188. + #ifndef atarist
  2189.         strcat (dumpname, ".jump2");
  2190. + #else
  2191. +       strcat (dumpname, ".jp2");
  2192. + #endif
  2193.         jump2_opt_dump_file = fopen (dumpname, "w");
  2194.         if (jump2_opt_dump_file == 0)
  2195.       pfatal_with_name (dumpname);
  2196. ***************
  2197. *** 1707,1713 ****
  2198. --- 1772,1782 ----
  2199.       {
  2200.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 10);
  2201.         strcpy (dumpname, dump_base_name);
  2202. + #ifndef atarist
  2203.         strcat (dumpname, ".stack");
  2204. + #else
  2205. +       strcat (dumpname, ".stk");
  2206. + #endif
  2207.         stack_reg_dump_file = fopen (dumpname, "w");
  2208.         if (stack_reg_dump_file == 0)
  2209.       pfatal_with_name (dumpname);
  2210. ***************
  2211. *** 2748,2759 ****
  2212. --- 2817,2838 ----
  2213.     int version_flag = 0;
  2214.     char *p;
  2215.   
  2216. + #ifdef atarist
  2217. + /* turn this on if you are going to set the TOS 1.4 dont clear heap flag */
  2218. + /*  _malloczero(1); */     /* zero mallocs by default */
  2219. + #endif  
  2220.     /* save in case md file wants to emit args as a comment.  */
  2221.     save_argc = argc;
  2222.     save_argv = argv;
  2223.   
  2224.     p = argv[0] + strlen (argv[0]);
  2225. + #ifndef atarist
  2226.     while (p != argv[0] && p[-1] != '/') --p;
  2227. + #else
  2228. +   while (p != argv[0] && ((p[-1] != '/') && (p[-1] != '\\') &&
  2229. +               (p[-1] != ':'))) --p;
  2230. + #endif
  2231.     progname = p;
  2232.   
  2233.   #ifdef RLIMIT_STACK
  2234. ***************
  2235. *** 2770,2776 ****
  2236. --- 2849,2857 ----
  2237.   
  2238.     signal (SIGFPE, float_signal);
  2239.   
  2240. + #ifndef atarist
  2241.     signal (SIGPIPE, pipe_closed);
  2242. + #endif
  2243.   
  2244.     decl_printable_name = decl_name;
  2245.     lang_expand_expr = (struct rtx_def *(*)()) do_abort;
  2246. ***************
  2247. *** 2868,2873 ****
  2248. --- 2949,2964 ----
  2249.         else if (!strcmp (str, "dumpbase"))
  2250.           {
  2251.             dump_base_name = argv[++i];
  2252. + #ifdef atarist
  2253. + /* dump_base_name will typically be 'foo.c' here.  Need to truncate at the '.',
  2254. +    cause dots mean something here */
  2255. +         {
  2256. +           char * n = dump_base_name;
  2257. +           for ( ; ((*n) && (*n != '.')) ; )
  2258. +         n++;
  2259. +           *n = '\0';
  2260. +         }
  2261. + #endif
  2262.           }
  2263.         else if (str[0] == 'd')
  2264.           {
  2265. ***************
  2266. *** 3263,3269 ****
  2267. --- 3354,3366 ----
  2268.        option flags in use.  */
  2269.     if (version_flag)
  2270.       {
  2271. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  2272. + #include "PatchLev.h"
  2273. +         fprintf (stderr, "%s version %s-atariST Patchlevel %s",
  2274. +          language_string, version_string, PatchLevel);
  2275. + #else
  2276.         fprintf (stderr, "%s version %s", language_string, version_string);
  2277. + #endif
  2278.   #ifdef TARGET_VERSION
  2279.         TARGET_VERSION;
  2280.   #endif
  2281. ***************
  2282. *** 3284,3289 ****
  2283. --- 3381,3388 ----
  2284.   
  2285.     compile_file (filename);
  2286.   
  2287. + #if (!(defined(atarist) || defined(atariminix)))
  2288. + #if (!(defined(CROSSHPUX)))
  2289.   #ifndef OS2
  2290.   #ifndef VMS
  2291.     if (flag_print_mem)
  2292. ***************
  2293. *** 3302,3307 ****
  2294. --- 3401,3408 ----
  2295.       }
  2296.   #endif /* not VMS */
  2297.   #endif /* not OS2 */
  2298. + #endif
  2299. + #endif
  2300.   
  2301.     if (errorcount)
  2302.       exit (FATAL_EXIT_CODE);
  2303. ***************
  2304. *** 3413,3415 ****
  2305. --- 3514,3547 ----
  2306.   
  2307.     fprintf (stderr, "\n");
  2308.   }
  2309. + #ifdef atarist
  2310. + void atari_output_filename(file, filename)
  2311. + FILE *file;
  2312. + char *filename;
  2313. + {
  2314. +     if( (!file) || (!filename) ) return;
  2315. +     for(; *filename; filename++)
  2316. +     {
  2317. +     if(*filename == '\\') putc('\\', file);
  2318. +     putc(*filename, file);
  2319. +     }
  2320. + }
  2321. + #include <string.h>
  2322. + char *atari_filename_nondirectory(p)
  2323. + char *p;
  2324. + {
  2325. +     char *s;
  2326. +     
  2327. +     for(s = p + strlen(p); s != p; --s)
  2328. +     {
  2329. +     if((*s == '/') || (*s == '\\'))
  2330. +         break;
  2331. +     }
  2332. +     
  2333. +     return (s == p) ? p : s+1;
  2334. + }
  2335. + #endif
  2336. diff -c -r ngcc/varasm.c gcc/varasm.c
  2337. *** ngcc/varasm.c    Mon Dec 28 00:45:17 1992
  2338. --- gcc/varasm.c    Mon Dec 28 00:27:57 1992
  2339. ***************
  2340. *** 978,991 ****
  2341.   assemble_external_libcall (fun)
  2342.        rtx fun;
  2343.   {
  2344. - #ifdef ASM_OUTPUT_EXTERNAL_LIBCALL
  2345.     /* Declare library function name external when first used, if nec.  */
  2346.     if (! SYMBOL_REF_USED (fun))
  2347.       {
  2348.         SYMBOL_REF_USED (fun) = 1;
  2349.         ASM_OUTPUT_EXTERNAL_LIBCALL (asm_out_file, fun);
  2350. -     }
  2351.   #endif
  2352.   }
  2353.   
  2354.   /* Declare the label NAME global.  */
  2355. --- 978,991 ----
  2356.   assemble_external_libcall (fun)
  2357.        rtx fun;
  2358.   {
  2359.     /* Declare library function name external when first used, if nec.  */
  2360.     if (! SYMBOL_REF_USED (fun))
  2361.       {
  2362.         SYMBOL_REF_USED (fun) = 1;
  2363. + #ifdef ASM_OUTPUT_EXTERNAL_LIBCALL
  2364.         ASM_OUTPUT_EXTERNAL_LIBCALL (asm_out_file, fun);
  2365.   #endif
  2366. +     }
  2367.   }
  2368.   
  2369.   /* Declare the label NAME global.  */
  2370. ***************
  2371. *** 2232,2237 ****
  2372. --- 2232,2240 ----
  2373.        rtx x;
  2374.   {
  2375.     struct rtx_const val0, val1;
  2376. +   if (XEXP (x, 0) == pc_rtx || XEXP (x, 1) == pc_rtx)
  2377. +     return XEXP (x, 0) == XEXP (x, 1) ? const0_rtx : x;
  2378.   
  2379.     decode_rtx_const (GET_MODE (x), XEXP (x, 0), &val0);
  2380.     decode_rtx_const (GET_MODE (x), XEXP (x, 1), &val1);
  2381.